<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/google/protobuf/generated_message_util.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../index.html">top level</a> - <a href="index.html">usr/include/google/protobuf</a> - generated_message_util.h<span style="font-size: 80%;"> (source / <a href="generated_message_util.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">4</td>
            <td class="headerCovTableEntry">4</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:25:26</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntryHi">-</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Protocol Buffers - Google's data interchange format</a>
<span class="lineNum">       2 </span>            : // Copyright 2008 Google Inc.  All rights reserved.
<span class="lineNum">       3 </span>            : // https://developers.google.com/protocol-buffers/
<span class="lineNum">       4 </span>            : //
<span class="lineNum">       5 </span>            : // Redistribution and use in source and binary forms, with or without
<span class="lineNum">       6 </span>            : // modification, are permitted provided that the following conditions are
<span class="lineNum">       7 </span>            : // met:
<span class="lineNum">       8 </span>            : //
<span class="lineNum">       9 </span>            : //     * Redistributions of source code must retain the above copyright
<span class="lineNum">      10 </span>            : // notice, this list of conditions and the following disclaimer.
<span class="lineNum">      11 </span>            : //     * Redistributions in binary form must reproduce the above
<span class="lineNum">      12 </span>            : // copyright notice, this list of conditions and the following disclaimer
<span class="lineNum">      13 </span>            : // in the documentation and/or other materials provided with the
<span class="lineNum">      14 </span>            : // distribution.
<span class="lineNum">      15 </span>            : //     * Neither the name of Google Inc. nor the names of its
<span class="lineNum">      16 </span>            : // contributors may be used to endorse or promote products derived from
<span class="lineNum">      17 </span>            : // this software without specific prior written permission.
<span class="lineNum">      18 </span>            : //
<span class="lineNum">      19 </span>            : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<span class="lineNum">      20 </span>            : // &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<span class="lineNum">      21 </span>            : // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
<span class="lineNum">      22 </span>            : // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
<span class="lineNum">      23 </span>            : // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
<span class="lineNum">      24 </span>            : // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
<span class="lineNum">      25 </span>            : // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
<span class="lineNum">      26 </span>            : // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
<span class="lineNum">      27 </span>            : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<span class="lineNum">      28 </span>            : // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<span class="lineNum">      29 </span>            : // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<span class="lineNum">      30 </span>            : 
<span class="lineNum">      31 </span>            : // Author: kenton@google.com (Kenton Varda)
<span class="lineNum">      32 </span>            : //  Based on original Protocol Buffers design by
<span class="lineNum">      33 </span>            : //  Sanjay Ghemawat, Jeff Dean, and others.
<span class="lineNum">      34 </span>            : //
<span class="lineNum">      35 </span>            : // This file contains miscellaneous helper code used by generated code --
<span class="lineNum">      36 </span>            : // including lite types -- but which should not be used directly by users.
<span class="lineNum">      37 </span>            : 
<span class="lineNum">      38 </span>            : #ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__
<span class="lineNum">      39 </span>            : #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__
<span class="lineNum">      40 </span>            : 
<span class="lineNum">      41 </span>            : #include &lt;assert.h&gt;
<span class="lineNum">      42 </span>            : #include &lt;string&gt;
<span class="lineNum">      43 </span>            : 
<span class="lineNum">      44 </span>            : #include &lt;google/protobuf/stubs/once.h&gt;
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span>            : #include &lt;google/protobuf/stubs/common.h&gt;
<span class="lineNum">      47 </span>            : namespace google {
<span class="lineNum">      48 </span>            : 
<span class="lineNum">      49 </span>            : namespace protobuf {
<span class="lineNum">      50 </span>            : namespace internal {
<span class="lineNum">      51 </span>            : 
<span class="lineNum">      52 </span>            : 
<span class="lineNum">      53 </span>            : // Annotation for the compiler to emit a deprecation message if a field marked
<span class="lineNum">      54 </span>            : // with option 'deprecated=true' is used in the code, or for other things in
<span class="lineNum">      55 </span>            : // generated code which are deprecated.
<span class="lineNum">      56 </span>            : //
<span class="lineNum">      57 </span>            : // For internal use in the pb.cc files, deprecation warnings are suppressed
<span class="lineNum">      58 </span>            : // there.
<span class="lineNum">      59 </span>            : #undef DEPRECATED_PROTOBUF_FIELD
<span class="lineNum">      60 </span>            : #define PROTOBUF_DEPRECATED
<span class="lineNum">      61 </span>            : 
<span class="lineNum">      62 </span>            : 
<span class="lineNum">      63 </span>            : // Constants for special floating point values.
<span class="lineNum">      64 </span>            : LIBPROTOBUF_EXPORT double Infinity();
<span class="lineNum">      65 </span>            : LIBPROTOBUF_EXPORT double NaN();
<span class="lineNum">      66 </span>            : 
<span class="lineNum">      67 </span>            : // TODO(jieluo): Change to template. We have tried to use template,
<span class="lineNum">      68 </span>            : // but it causes net/rpc/python:rpcutil_test fail (the empty string will
<span class="lineNum">      69 </span>            : // init twice). It may related to swig. Change to template after we
<span class="lineNum">      70 </span>            : // found the solution.
<span class="lineNum">      71 </span>            : 
<span class="lineNum">      72 </span>            : // Default empty string object. Don't use the pointer directly. Instead, call
<span class="lineNum">      73 </span>            : // GetEmptyString() to get the reference.
<span class="lineNum">      74 </span>            : LIBPROTOBUF_EXPORT extern const ::std::string* empty_string_;
<span class="lineNum">      75 </span>            : LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_;
<span class="lineNum">      76 </span>            : LIBPROTOBUF_EXPORT void InitEmptyString();
<span class="lineNum">      77 </span>            : 
<span class="lineNum">      78 </span>            : 
<span class="lineNum">      79 </span>            : LIBPROTOBUF_EXPORT inline const ::std::string&amp; GetEmptyStringAlreadyInited() {
<span class="lineNum">      80 </span>            :   assert(empty_string_ != NULL);
<span class="lineNum">      81 </span><span class="lineCov">      21383 :   return *empty_string_;</span>
<span class="lineNum">      82 </span>            : }
<span class="lineNum">      83 </span>            : LIBPROTOBUF_EXPORT inline const ::std::string&amp; GetEmptyString() {
<span class="lineNum">      84 </span><span class="lineCov">        403 :   ::google::protobuf::GoogleOnceInit(&amp;empty_string_once_init_, &amp;InitEmptyString);</span>
<span class="lineNum">      85 </span>            :   return GetEmptyStringAlreadyInited();
<span class="lineNum">      86 </span>            : }
<span class="lineNum">      87 </span>            : 
<span class="lineNum">      88 </span>            : // Defined in generated_message_reflection.cc -- not actually part of the lite
<span class="lineNum">      89 </span>            : // library.
<span class="lineNum">      90 </span>            : //
<span class="lineNum">      91 </span>            : // TODO(jasonh): The various callers get this declaration from a variety of
<span class="lineNum">      92 </span>            : // places: probably in most cases repeated_field.h. Clean these up so they all
<span class="lineNum">      93 </span>            : // get the declaration from this file.
<span class="lineNum">      94 </span>            : LIBPROTOBUF_EXPORT int StringSpaceUsedExcludingSelf(const string&amp; str);
<span class="lineNum">      95 </span>            : 
<span class="lineNum">      96 </span>            : 
<span class="lineNum">      97 </span>            : // True if IsInitialized() is true for all elements of t.  Type is expected
<span class="lineNum">      98 </span>            : // to be a RepeatedPtrField&lt;some message type&gt;.  It's useful to have this
<span class="lineNum">      99 </span>            : // helper here to keep the protobuf compiler from ever having to emit loops in
<span class="lineNum">     100 </span>            : // IsInitialized() methods.  We want the C++ compiler to inline this or not
<span class="lineNum">     101 </span>            : // as it sees fit.
<span class="lineNum">     102 </span>            : template &lt;class Type&gt; bool AllAreInitialized(const Type&amp; t) {
<span class="lineNum">     103 </span><span class="lineCov">         22 :   for (int i = t.size(); --i &gt;= 0; ) {</span>
<span class="lineNum">     104 </span><span class="lineCov">         20 :     if (!t.Get(i).IsInitialized()) return false;</span>
<span class="lineNum">     105 </span>            :   }
<span class="lineNum">     106 </span>            :   return true;
<span class="lineNum">     107 </span>            : }
<span class="lineNum">     108 </span>            : 
<span class="lineNum">     109 </span>            : }  // namespace internal
<span class="lineNum">     110 </span>            : }  // namespace protobuf
<span class="lineNum">     111 </span>            : 
<span class="lineNum">     112 </span>            : }  // namespace google
<span class="lineNum">     113 </span>            : #endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
